﻿using Abp.Web.Models;
using Microsoft.AspNetCore.Mvc;
using AbpProjectTemplate.Components.Runtime;
using AbpProjectTemplate.Web.UEditor;
using Abp.AspNetCore.Mvc.Authorization;
using AbpProjectTemplate.Components.Authorization;

namespace AbpProjectTemplate.Web.Controllers
{
    public class UEditorController : AppApiControllerBase
    {
        private readonly UEditorService _ue;
        public UEditorController(UEditorService ue)
        {
            this._ue = ue;
        }

        /// <summary>
        /// UE编辑器上传获取接口
        /// </summary>
        [HttpGet, HttpPost]
        public void Do(string action)
        {
            //if (this.Request.Method.ToLower() == "post")
            //{
            //    if (!this.AbpSession.IsAdmin())
            //        throw new AppUserFriendlyException("没有权限的操作。");
            //}
            this._ue.DoAction(this.HttpContext);
        }
    }
}
